﻿using System.Collections.Generic;
using DevExpress.Skins;

namespace MicropleSoft.Controls.Style
{
    public class UiStyleController
    {
        public static List<IStyleItem> GetStyleItems()
        {
            var list = new List<IStyleItem>();
            foreach (SkinContainer cnt in SkinManager.Default.Skins)
            {
                IStyleItem item = new StyleItem(cnt.SkinName);
                //if(item.StyleName == FormMain.FormMainInstance.defaultLookAndFeel.LookAndFeel.SkinName)
                //{
                //    item.CheckItem(null);
                //}
                //list.Add(item);
            }
            return list;
        }
    }

    public  interface  IStyleItem
    {
        string StyleName { get;  }
        bool Checked { get;  }
        void UnCheckItem();
        void CheckItem(IStyleItem original);
    }

    public class StyleItem : IStyleItem
    {
        public StyleItem(string styleName)
        {
            StyleName = styleName;
        }
        public string StyleName { get; private set; }
        public bool Checked { get; private set; }
        public void UnCheckItem()
        {
            this.Checked = false;
        }
        public void CheckItem(IStyleItem original)
        {
            if (original != null)
            {
                original.UnCheckItem();
            }
            this.Checked = true;
        }
    }
}
